﻿public class PlayerUseItem : PlayerBaseState {
	bool _canExit;
	public PlayerUseItem(PlayerController controller, PlayerStateEnum stateName, State<PlayerStateEnum> superFSM, StateFactory<PlayerStateEnum> factory) : base(controller, stateName, superFSM, factory) {
		AddConditionToSelf(() => controller.UseItemInput);

		AddNewTransition(PlayerStateEnum.Idle, () => _canExit);
	}

	public override void Enter() {
		_controller.PlayAnim(PlayerStateEnum.UseItem);
		_canExit = false;

	}

	public override void Update() {
		base.Update();
		if (_controller.IsAnimPlayOver()) {
			_canExit = true;
		}
	}

	public override void Exit() {

	}
}